package com.xiaomo.gitee.datamanager.mapper;
import java.util.Collection;
import java.util.List;

import com.xiaomo.gitee.datamanager.cache.MybatisRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;

import com.xiaomo.gitee.datamanager.entity.CategoryTag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

@Mapper
@CacheNamespace(implementation = MybatisRedisCache.class,eviction = MybatisRedisCache.class)
public interface CategoryTagMapper extends BaseMapper<CategoryTag> {

    List<CategoryTag> selectAllByTagId(@Param("tagId") Long tagId);

    List<CategoryTag> selectAllByChildClassId(@Param("childClassId") Long childClassId);

    int deleteByTagId(@Param("tagId") Long tagId);

    int deleteByChildClassId(@Param("childClassId") Long childClassId);

    int deleteByTagIdAndChildClassId(@Param("tagId") Long tagId, @Param("childClassId") Long childClassId);
    @Override
    int insert(CategoryTag entity);

    int insertBatch(@Param("categoryTagCollection") Collection<CategoryTag> categoryTagCollection);

}




